<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.util.Date"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="date" value="<%=new Date()%>" />
<fmt:formatDate var="today" value="${date }" type="date"
	pattern="yyyy-MM-dd HH:mm:ss" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- -------------------------------------------------------------------------------------- -->
<script type="text/javascript">
	$(document).ready(function() {
		$("#saveBtn").click(function() {
			saveWriteBoard();
		});
		$("#cancleBtn").click(function() {
			openMainBoard();
		});
	});

	function saveWriteBoard() {
		$("#saveBoardForm").submit();
	}
	function openMainBoard() {
		$("#openMainBoard").submit();
	}
</script>
<!-- -------------------------------------------------------------------------------------- -->
<title>WriteBoard</title>
</head>

<body>
	<form id="saveBoardForm" name="saveBoardForm"
		action="/${initParam.context_root }/saveBoard.do" method="post">
		<input type="hidden" id="regDate" name="regDate" value="${today }">
		${message }
		<table>
			<tr>
				<td>작성자</td>
				<td><input type="text" id="regName" name="regName" size="50"></td>
			</tr>
			<tr>
				<td>제목</td>
				<td><input type="text" id="subject" name="subject" size="90"></td>
			</tr>
			<tr>
				<td>내용</td>
				<td><textarea id="content" name="content" cols="70" rows="30"></textarea></td>
			</tr>
		</table>
		<div align="right">
			<button id="saveBtn" title="작성완료">작성완료</button>
		</div>
	</form>
	<form id="openBoardForm" name="openBoardForm"
		action="/${initParam.context_root }/mainBoard.do" method="post">
		<div align="right">
			<button id="cancleBtn" title="취소">취소</button>
		</div>
	</form>
</body>
</html>